<template>
	<!-- 父级必须有定位属性：relative / absolute -->
	<view :style="{'--width':boxWidth,'--size':fontSize}">
		<view class="no_bg" v-if="hasbg"></view>
		<view class="no_prod">
			<view class="no_box">
				<view class="">{{title}}</view>
				<view class="line_box">
					<view class="line line_l"></view>
					<view class="cir"></view>
					<view class="line line_r"></view>
				</view>
				<view class="en">Sold out</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	props: {
		title:{
			type:String,
			default:'已售罄'
		},
		hasbg:{
			type:Boolean,
			default:true
		}, // 是否有遮罩层
		boxWidth:{
			type:String,
			default:'150rpx'
		},
		fontSize:{
			type:String,
			default:'24rpx'
		}
	},
	components: {},
	data() {
		return {};
	},

	mounted() {},

	methods: {}
};
</script>

<style scoped lang="scss">
.no_bg {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.4);
}
.no_prod {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: var(--width);
	height: var(--width);
	background-color: rgba(0, 0, 0, 0.6);
	text-align: center;
	color: #fff;
	border-radius: 50%;
	overflow: hidden;
	.no_box {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		font-size: var(--size);
		white-space: nowrap;
		.line_box {
			display: flex;
			align-items: center;
			margin: 8rpx 0 6rpx;
			.line {
				height: 4rpx;
				background-color: #fff;
				flex: 1;
				overflow: hidden;
			}
			.cir {
				background-color: #fff;
				margin: 0 12rpx;
				width: 14rpx;
				height: 14rpx;
				border-radius: 50%;
				overflow: hidden;
			}
		}
	}
}
</style>
